<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="oneroom.admin.code.codeModel" %>
<jsp:useBean id="codeDao" scope="page" class="oneroom.admin.code.codeDao" />
<%
	List subwayList = codeDao.getDtlList("001");// 지하철
	List heatingList = codeDao.getDtlList("300");// 난방 시설
	List airconditioningList = codeDao.getDtlList("301");// 냉방 시설
	List  university1List = codeDao.getDtlList("400");// 대학교 지역
	List  roomnumberList = codeDao.getDtlList("500");// 매물 종류
	List  furnitureList = codeDao.getDtlList("302");// 가구
	List  appliancesList = codeDao.getDtlList("303");//가전
	List  kitchenList = codeDao.getDtlList("304"); //주방
	List  securityList = codeDao.getDtlList("305"); //보안
	List  facilityList = codeDao.getDtlList("306"); //주변시설
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>원룸 - 매물 정보</title>
<script type="text/javascript" src="/admin/js/default.js"></script>
<link href="/admin/css/default.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 6]><link rel="stylesheet" href="/admin/css/forie6.css" type="text/css" /><![endif]-->
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
	
	$('#btList').click(function() {
		window.location.href="list.jsp";
	});
	$('#zip_code').click(function() {
		window.open('/admin/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=500px,width=500px');
	});
	$('#address1').click(function() {
		window.open('/admin/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=500px,width=500px');
	});
	$('#address2').click(function() {
		window.open('/admin/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=500px,width=500px');
	});
	$('#address3').click(function() {
		window.open('/admin/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=500px,width=500px');
	});
	$('#address4').click(function() {
		window.open('/admin/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=500px,width=500px');
	});
	$('#address5').click(function() {
		window.open('/admin/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=500px,width=500px');
	});
	$('#zipcode1').click(function() {
		window.open('/admin/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=500px,width=500px');
	});
	$('#zipcode2').click(function() {
		window.open('/admin/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=500px,width=500px');
	});
	$('#subway1').change(function() {
		$.ajax({type : "post",
			url : "/admin/room/subway.jsp",
			dataType : "html",
			data : "maincode="+document.getElementById("subway1").value,
			success : function(msg){
				document.getElementById("divSubWay2").innerHTML = msg;
			}
		});
	});
	$('#university1').change(function() {
		$.ajax({type : "post",
			url : "/admin/room/university2.jsp",
			dataType : "html",
			data : "maincode="+document.getElementById("university1").value,
			success : function(msg){
				document.getElementById("divuniversity2").innerHTML = msg;
			}
		});
	});
	
	
	
});
function display(no){
    for(var i=1; i<=2; i++){
        document.getElementById("charter_type"+i).style.display="none";
    }
    document.getElementById("charter_type"+no).style.display="block";
    if(no == "2"){
    	document.getElementById("charter_name").innerHTML = "월세";
    }else{
    	document.getElementById("charter_name").innerHTML = "전세";
    }
}
//-->
</script>
</head>
<body>
<div id="bodywrap">
	<div class="all-wrap">
		<%@ include file="/admin/common/top.jsp" %>
		<div id="right-wrap">
			<%@ include file="/admin/common/navi.jsp" %>
			<!--Contents Start-->
			<div id="content">
				<form action="roomdbx.jsp" name="frm" id="frm" method="post" enctype="multipart/form-data"> 
				<input type="hidden" name="gubun" value="I" />
				<!-- 타이틀 및 전체 갯수 검색 시작 -->
				<div class="path">
					<span>home</span> &gt;  매물 정보
				</div>
				<h4>매물 정보</h4>
				<p class="sub-text">매물 정보 확인/관리 하실 수 있습니다.</p>
				<!-- 타이틀 및 전체 갯수 검색  끝-->
				<!-- 실제적인 리스트 시작 -->
				<p class="sub-text2">기본 정보</p>
					<table class="view-normal" cellpadding="0" cellspacing="0" summary="매물 정보" >
					<caption>매물 정보</caption>
					    <col width="100px" />  
					    <col width="239px" />  
					    <col width="100px" />  
					    <col width="239px" />  
				    <tbody>
						<tr>
							<th scope="row" >주소</th>
							<td>
								<input name="address1" id="address1" value="" title="주소 입력" type="text"  style="width:40px;" readonly="readonly" />
								<input name="address2" id="address2" value="" title="주소 입력" type="text"  style="width:40px;" readonly="readonly" />
								<input name="address3" id="address3" value="" title="주소 입력" type="text"  style="width:40px;" readonly="readonly"/>
								<input name="address4" id="address4" value="" title="주소 입력" type="text"  style="width:40px;" readonly="readonly" /><br>
								<input name="address5" id="address5" value="" title="주소 입력" type="text"  style="width:200px;" readonly="readonly" />
							</td>
							<th scope="row" >번지</th>
							<td>
								<input name="zipcode1" id="zipcode1" value="" title="주소 입력" type="text"  style="width:50px;" readonly="readonly"/>
								~ <input name="zipcode2" id="zipcode2" value="" title="주소 입력" type="text"  style="width:50px;" readonly="readonly" />
								<input type="button" name="zip_code" id="zip_code" value="주소 검색" class="btn-bg-gray" />
							</td>
				        </tr>
				        <tr>
							<th scope="row" >방수</th>
							<td>
								<select name="roomnumber" style="width:50px;">
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
								</select> 개
							</td>
							<th scope="row" >매물종류 </th>
							<td>
<%
	for(int i = 0; i < roomnumberList.size(); i++){
		codeModel mode = (codeModel)roomnumberList.get(i);
%>
									<input type="radio" name="roomkind" value="<%=mode.getCode() %>" <%if(i==0){ %>checked="checked" <%} %>/> <%=mode.getCodename() %>				
<%
	}
%>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >평수</th>
							<td>
								<input name="roomarea" id="roomarea" value="" title="평수" type="text"  style="width:50px;" /> 평
							</td>
						    <th scope="row">임대형태</th>
						    <td>
						    <input type="radio" name="charter" value="J" checked="checked" onclick="display('1');"/>전세 
							<input type="radio" name="charter" value="W" onclick="display('2');"/>월세
							</td>							
				        </tr>
				        <tr>
							<th scope="row" >층</th>
							<td>
								<select name="roomfloor1" style="width:50px;">
									<option value="1">1층</option>
									<option value="2">2층</option>
									<option value="3">3층</option>
									<option value="4">4층</option>
									<option value="5">5층</option>
									<option value="6">6층</option>
									<option value="7">7층</option>
									<option value="8">8층</option>
									<option value="9">9층</option>
									<option value="10">10층</option>
									<option value="11">11층</option>
									<option value="12">12층</option>
									<option value="13">13층</option>
									<option value="14">14층</option>
									<option value="15">15층</option>
									<option value="16">16층</option>
									<option value="17">17층</option>
									<option value="18">18층</option>
									<option value="19">19층</option>
									<option value="20">20층</option>
									<option value="21">21층</option>
									<option value="22">22층</option>
									<option value="23">23층</option>
									<option value="24">24층</option>
									<option value="25">25층</option>
									<option value="26">26층</option>
									<option value="27">27층</option>
									<option value="28">28층</option>
									<option value="29">29층</option>
									<option value="30">30층</option>
									<option value="31">31층</option>
									<option value="32">31층</option>
									<option value="32">32층</option>
									<option value="33">33층</option>
									<option value="34">34층</option>
									<option value="35">35층</option>
									<option value="36">36층</option>
									<option value="37">37층</option>
									<option value="38">38층</option>
									<option value="39">39층</option>
									<option value="40">40층</option>
								</select> / 
								<select name="roomfloor2" style="width:50px;">
									<option value="1">1층</option>
									<option value="2">2층</option>
									<option value="3">3층</option>
									<option value="4">4층</option>
									<option value="5">5층</option>
									<option value="6">6층</option>
									<option value="7">7층</option>
									<option value="8">8층</option>
									<option value="9">9층</option>
									<option value="10">10층</option>
									<option value="11">11층</option>
									<option value="12">12층</option>
									<option value="13">13층</option>
									<option value="14">14층</option>
									<option value="15">15층</option>
									<option value="16">16층</option>
									<option value="17">17층</option>
									<option value="18">18층</option>
									<option value="19">19층</option>
									<option value="20">20층</option>
									<option value="21">21층</option>
									<option value="22">22층</option>
									<option value="23">23층</option>
									<option value="24">24층</option>
									<option value="25">25층</option>
									<option value="26">26층</option>
									<option value="27">27층</option>
									<option value="28">28층</option>
									<option value="29">29층</option>
									<option value="30">30층</option>
									<option value="31">31층</option>
									<option value="32">31층</option>
									<option value="32">32층</option>
									<option value="33">33층</option>
									<option value="34">34층</option>
									<option value="35">35층</option>
									<option value="36">36층</option>
									<option value="37">37층</option>
									<option value="38">38층</option>
									<option value="39">39층</option>
									<option value="40">40층</option>
								</select>
							</td>
					   		<th scope="row"><span id="charter_name">전세</span></th>
					   		<td>
							<div id="charter_type1"  style="display: block;">
							<input name="roommoney" id="roommoney" value="" title="전세금" type="text"  style="width:50px;" /> 만원
							</div>
							<div id="charter_type2"  style="display: none;">
							보증금 : <input name="roommonth1" id="roommonth1" value="" title="월세 보증금" type="text"  style="width:50px;" /> 만원 /<br/> 
							월 : <input name="roommonth2" id="roommonth2" value="" title="월세금" type="text"  style="width:50px;" /> 만원
							</div>					
							</td>
				        </tr>
				        <tr>
							<th scope="row" >주차</th>
							<td>
								<select name="car" style="width:50px;">
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
								</select> 대
							</td>
							<th scope="row" >관리비 </th>
							<td>
								<input name="managemoney" id="managemoney" value="" title="관리비" type="text"  style="width:100px;" /> 만원
							</td>
				        </tr>
					</tbody>
					</table>
					<br></br>
					<p class="sub-text2"> 주변 환경 및 옵션 정보</p>
					<table class="view-normal" cellpadding="0" cellspacing="0" summary="매물 정보" >
					<caption>매물 정보</caption>
					    <col width="100px;" />  
					    <col width="100px;" />  
					    <col width="100px;" />  
					    <col />  
				    <tbody>
					<tr>
					    <th scope="row" >매물옵션</th>
					    <td colspan="3" >
						<select name="roomoption" id="roomoption" style="width:80px;">
							<option value="">선택</option>
							<option value="D" >직거래</option>
							<option value="M" >반값</option>	
						</select>
					 </tr>					    
				     <tr>
							<th scope="row" >지하철</th>
							<td>
								<select name="subway1" id="subway1" style="width:100px;">
									<option value="선택">선택</option>
<%
	for(int i = 0; i < subwayList.size(); i++){
		codeModel mode = (codeModel)subwayList.get(i);
%>
									<option value="<%=mode.getCode() %>"><%=mode.getCodename() %></option>					
<%
	}
%>
								</select>
							</td>
							<td>
								<div id="divSubWay2">
								<select name="subway2" style="width:100px;">
									<option value="선택">선택</option>
								</select>
								</div>
							</td>
							<td>
								<select name="subway3" style="width:100px;">
									<option value="5분거리">5분거리</option>
									<option value="10분거리">10분거리</option>
									<option value="15분거리">15분거리</option>
									<option value="20분거리">20분거리</option>
									<option value="25분거리">25분거리</option>
									<option value="30분거리">30분거리</option>
									<option value="35분거리">35분거리</option>
									<option value="40분거리">40분거리</option>
									<option value="45분거리">45분거리</option>
								</select>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >난방시설</th>
							<td>
								<select name="heating" style="width:100px;">

<%
	for(int i = 0; i < heatingList.size(); i++){
		codeModel mode = (codeModel)heatingList.get(i);
%>
									<option value="<%=mode.getCode() %>"><%=mode.getCodename() %></option>					
<%
	}
%>
								</select>
							</td>
							<th scope="row" >냉방시설 </th>
							<td>
								<select name="airconditioning" style="width:100px;">
<%
	for(int i = 0; i < airconditioningList.size(); i++){
		codeModel mode = (codeModel)airconditioningList.get(i);
%>
									<option value="<%=mode.getCode() %>"><%=mode.getCodename() %></option>					
<%
	}
%>
									<option value="에어콘">에어콘</option>
									<option value="중앙냉방">중앙냉방</option>
									<option value="선풍기">선풍기</option>
								</select>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >대학교</th>
							<td>
								<select name="university1" id="university1" style="width:100px;">
<%
	for(int i = 0; i < university1List.size(); i++){
		codeModel mode = (codeModel)university1List.get(i);
%>
									<option value="<%=mode.getCode() %>"><%=mode.getCodename() %></option>					
<%
	}
%>								
								</select>
							</td>
							<td colspan="2">
								<div id="divuniversity2">
								<select name="university2" style="width:100px;">
									<option value="선택">선택</option>
								</select>
								</div>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >임대형태</th>
							<td colspan="3">
								<input type="radio" name="lease" value="즉시임주" />즉시입주
								<input type="radio" name="lease" value="입주가능일 지정" />입주가능일 지정
								
								<select name="leaseyear" style="width:100px;">
									<option value="2011">2011</option>
									<option value="2010">2010</option>
									<option value="2009">2009</option>
									<option value="2008">2008</option>
								</select>
								<select name="leasemonth" style="width:100px;">
									<option value="12">12</option>
									<option value="11">11</option>
									<option value="10">10</option>
									<option value="9">9</option>
									<option value="8">8</option>
									<option value="7">7</option>
									<option value="6">6</option>
									<option value="5">5</option>
									<option value="4">4</option>
									<option value="3">3</option>
									<option value="2">2</option>
									<option value="1">1</option>
								</select>
								<select name="leaseday" style="width:100px;">
									<option value="31">31</option>
									<option value="30">30</option>
									<option value="29">29</option>
									<option value="28">28</option>
									<option value="27">27</option>
									<option value="26">26</option>
									<option value="25">25</option>
									<option value="24">24</option>
									<option value="23">23</option>
									<option value="22">22</option>
									<option value="21">21</option>
									<option value="20">20</option>
									<option value="19">19</option>
									<option value="18">18</option>
									<option value="17">17</option>
									<option value="16">16</option>
									<option value="15">15</option>
									<option value="14">14</option>
									<option value="13">13</option>
									<option value="12">12</option>
									<option value="11">11</option>
									<option value="10">10</option>
									<option value="9">9</option>
									<option value="8">8</option>
									<option value="7">7</option>
									<option value="6">6</option>
									<option value="5">5</option>
									<option value="4">4</option>
									<option value="3">3</option>
									<option value="2">2</option>
									<option value="1">1</option>
								</select>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >가구</th>
							<td colspan="3">
							
<%
	for(int i = 0; i < furnitureList.size(); i++){
		codeModel mode = (codeModel)furnitureList.get(i);
%>
									<input type="checkbox" name="furniture1" id="furniture1" value="<%=mode.getCode() %>" /> <%=mode.getCodename() %>				
<%
	}
%>	
							</td>
				        </tr>
				        <tr>
							<th scope="row" >가전</th>
							<td colspan="3">
<%
	for(int i = 0; i < appliancesList.size(); i++){
		codeModel mode = (codeModel)appliancesList.get(i);
%>
									<input type="checkbox" name="appliances1" id="appliances1" value="<%=mode.getCode() %>" /> <%=mode.getCodename() %>				
<%
	}
%>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >주방/욕실</th>
							<td colspan="3">
<%
	for(int i = 0; i < kitchenList.size(); i++){
		codeModel mode = (codeModel)kitchenList.get(i);
%>
									<input type="checkbox" name="kitchen1" id="kitchen1" value="<%=mode.getCode() %>" /> <%=mode.getCodename() %>				
<%
	}
%>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >보완</th>
							<td colspan="3">
<%
	for(int i = 0; i < securityList.size(); i++){
		codeModel mode = (codeModel)securityList.get(i);
%>
									<input type="checkbox" name="security1" id="security1" value="<%=mode.getCode() %>" /> <%=mode.getCodename() %>				
<%
	}
%>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >주변시설</th>
							<td colspan="3">
<%
	for(int i = 0; i < facilityList.size(); i++){
		codeModel mode = (codeModel)facilityList.get(i);
%>
									<input type="checkbox" name="facility1" id="facility1" value="<%=mode.getCode() %>" /> <%=mode.getCodename() %>				
<%
	}
%>         
							</td>
				        </tr>
				    </tbody>
					</table>
					<br></br>
					<p class="sub-text2"> 홍보사항 </p>
					<table class="view-normal" cellpadding="0" cellspacing="0" summary="홍보사항" >
					<caption>홍보사항</caption>
					    <col width="100px" />  
					    <col width="239px" />  
					    <col width="100px" />  
					    <col width="239px" />  
				    <tbody>
				     	<tr>
							<th scope="row" >제목</th>
							<td colspan="3">
							<input name="title" id="title" value="" title="제목" type="text"  style="width:400px;" />
							</td>
				        </tr>
				        <tr>
							<th scope="row" >내용</th>
							<td colspan="3">
							<textarea name="content" style="width:400px; height:300px;"></textarea>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >담당자</th>
							<td>
							<input name="person" id="person" value="" title="담당자" type="text"  style="width:100px;" />
							</td>
							<th scope="row" >연락처</th>
							<td>
							<input name="tel1" id="tel1" value="" title="연락처1" type="text" maxlength="3" style="width:50px;" /> -
							<input name="tel2" id="tel2" value="" title="연락처2" type="text" maxlength="4" style="width:50px;" /> - 
							<input name="tel3" id="tel3" value="" title="연락처3" type="text" maxlength="4" style="width:50px;" />
							</td>
				        </tr>
				    </tbody>
					</table>
					<br></br>
					<p class="sub-text2"> 사진등록 </p>
					<table class="view-normal" cellpadding="0" cellspacing="0" summary="홍보사항" >
					<caption>홍보사항</caption> 
					    <col width="339px" />   
					    <col width="339px" />  
				    <tbody>
				     	<tr>
							<td>
							<input type="file" name="photo1" id="photo1" style="width:265px;" /> <input type="radio" name="photo1_main" value="1"/> 메인
							</td>
							<td>
							<input type="file" name="photo2" id="photo2" style="width:265px;" /> <input type="radio" name="photo1_main" value="2"/> 메인
							</td>
				        </tr>
				        <tr>
							<td>
							<input type="file" name="photo3" id="photo3" style="width:265px;" /> <input type="radio" name="photo1_main" value="3"/> 메인
							</td>
							<td>
							<input type="file" name="photo4" id="photo4" style="width:265px;" /> <input type="radio" name="photo1_main" value="4"/> 메인
							</td>
				        </tr>
				        <tr>
							<td>
							<input type="file" name="photo5" id="photo5" style="width:265px;" /> <input type="radio" name="photo1_main" value="5"/> 메인
							</td> 
							<td>
							<input type="file" name="photo6" id="photo6" style="width:265px;" /> <input type="radio" name="photo1_main" value="6"/> 메인
							</td>
				        </tr>
				    </tbody>
					</table>
				<!-- 버튼 시작 -->
				<div class="btn-all-align2">
				  <span class="btn-align"><input type="submit" value="등록" class="btn-bg-gray"  /></span>
				  <span class="btn-align"><input type="button" value="목록" id="btList" class="btn-bg-gray"  /></span>
				</div>
				<!-- 버튼 끝 -->
				<!-- 실제적인 리스트 끝 -->
				</form>
			</div>
			<!--Contents End-->
		</div>
	</div>
</div>
<!--floater-->
<%@ include file="/admin/common/bottom.jsp" %>
<!--floater-->
</body>
</html>